// Copyright (c) 2025-present AutoStories Contributors.
// All contributors are listed in CONTRIBUTORS.yaml at monorepo root.
//
// AutoStories is licensed under Mulan PSL v2.
// You can use this software according to the terms
// and conditions of the Mulan PSL v2.
// You may obtain a copy of Mulan PSL v2 at:
//
//   http://license.coscl.org.cn/MulanPSL2
//
// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS,
// WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
// See the Mulan PSL v2 for more details.
//
// 上述开源协议注释乃程序自动生成，请勿编辑
// === Auto generated, DO NOT EDIT ABOVE ===

import 'package:auto_stories/auto_stories.dart';

class Theme extends ThemeBase {
  const Theme.light({
    super.brightness,
    super.foreground = Colors.ink,
    super.background = Colors.snow,
    this.sidebar = const SidebarTheme(
      foreground: Colors.ink,
      background: Colors.paper,
    ),
  }) : super.light();

  const Theme.dark({
    super.brightness,
    super.foreground = Colors.lunar,
    super.background = Colors.coal,
    this.sidebar = const SidebarTheme(
      foreground: Colors.lunar,
      background: Colors.night,
    ),
  }) : super.dark();

  factory Theme.lerp(Theme a, Theme b, double t) => Theme.light(
    brightness: t < 0.5 ? a.brightness : b.brightness,
    background: lerpColor(a.background, b.background, t),
    foreground: lerpColor(a.foreground, b.foreground, t),
  );

  final SidebarTheme sidebar;

  static ThemeAdapter<Theme> adapter({ThemeMode mode = ThemeMode.system}) {
    return ThemeAdapter(
      light: const Theme.light(),
      dark: const Theme.dark(),
      mode: mode,
    );
  }
}
